//package com.agentai.security.service;
//
//import lombok.AllArgsConstructor;
//import com.agentai.framework.security.mobile.MobileUserDetailsService;
//import com.agentai.system.convert.SysUserConvert;
//import com.agentai.system.mapper.SysUserMapper;
//import com.agentai.system.entity.SysUserEntity;
//import com.agentai.system.service.SysUserDetailsService;
//import org.springframework.security.core.userdetails.UserDetails;
//import org.springframework.security.core.userdetails.UsernameNotFoundException;
//import org.springframework.stereotype.Service;
//
///**
// * 手机验证码登录 MobileUserDetailsService
//  */
//@Service
//@AllArgsConstructor
//public class MobileUserDetailsServiceImpl implements MobileUserDetailsService {
//    private final SysUserDetailsService sysUserDetailsService;
//    private final SysUserMapper sysUserMapper;
//
//    @Override
//    public UserDetails loadUserByMobile(String mobile) throws UsernameNotFoundException {
//        SysUserEntity userEntity = sysUserMapper.getByMobile(mobile);
//        if (userEntity == null) {
//            throw new UsernameNotFoundException("手机号或验证码错误");
//        }
//
//        return sysUserDetailsService.getUserDetails(SysUserConvert.INSTANCE.convertDetail(userEntity));
//    }
//
//}
